<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
<title></title>
</h:head>

<h:body>
<ui:include src="/painel.xhtml"></ui:include>
	<h:form prependId="false">
		<p:dataTable id="tblCliente" value="#{cliMB.listaClientes}" var="cli" paginator="true" rows="10" paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}" >
			<f:facet name="header">LISTAGEM DE CLIENTES</f:facet>
		
		<p:column >
			<f:facet name="header">NOME</f:facet>
			<h:outputText value="#{cli.nomeCliente}" />
		</p:column>
		
		<p:column >
		<f:facet name="header">CPF</f:facet>
			<h:outputText value="#{cli.cpf}" >
				</h:outputText>
		</p:column>
		
		<p:column >
			<f:facet name="header">LOGIN</f:facet>
			<h:outputText value="#{cli.usuarioCli.login}" />
		</p:column>		
		
		<p:column headerText="AÇÕES">
		<center>
		
			<h:commandLink value="editar" title="Editar" actionListener="#{cliMB.redireciona}" >
				<p:graphicImage value="/imagens/editar16.png" />
				<f:setPropertyActionListener target="#{cliMB.cliente}" value="#{cli}" />				
			</h:commandLink>
			-|-
			<h:commandLink value="excluir" action="#{cliMB.excluir}">
				<p:graphicImage value="/imagens/excluir16.png" />
				<f:setPropertyActionListener target="#{cliMB.cliente}" value="#{cli}" />
				
			</h:commandLink>
		</center>
		</p:column>
		<p:separator />
		</p:dataTable>
	
	</h:form>

</h:body>

</html>